#include "thread.h"

int enDirQueue(dirQueue_t * queue,char* dir){
    dirNode_t *newNode=(dirNode_t*)malloc(sizeof(node_t));
    strcpy(newNode->dirName,dir);

    newNode->pNext=queue->pFornt;
    queue->pFornt=newNode;

    queue->size++;
    return 0;
}

int outDirQueue(dirQueue_t * queue){
    dirNode_t* tmep=queue->pFornt->pNext;
    free(queue->pFornt);
    queue->pFornt=tmep;

    queue->size--;
    return 0;
}

int creatDirID(char * user,dirID_t*dirID){
    getcwd(dirID->pwdID,sizeof(dirID->pwdID));
    dirNode_t*userNode=(dirNode_t*)malloc(sizeof(dirNode_t));
    strcpy(userNode->dirName,user);
    userNode->pNext=NULL;

    dirID->userID.pFornt=userNode;
    dirID->userID.pRear=userNode;
    dirID->userID.size=1;
    
}
